package odeoncinemaassignment;
import java.awt.Color;
import java.sql.*;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.Vector;
import javax.swing.BorderFactory;
import javax.swing.ButtonModel;
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JOptionPane;
import javax.swing.ListModel;
import net.proteanit.sql.DbUtils;
import org.jdesktop.swingx.JXDatePicker;
public class adminFrame extends javax.swing.JFrame {
    Connection conn=utilities.connectDB(); // open database connection
    ResultSet rs = null;
    PreparedStatement pst = null;
    Date d = new Date();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); // To format date so is entered into database correctly
    String screen="";
    String classification="";  
    public static ArrayList al = new ArrayList();
    public DefaultListModel lm = new DefaultListModel();//Static list model to store titles populated by db hence public
    public adminFrame() throws SQLException {
        initComponents();
        utilities.populateJList(filmsNowShowingList,"select * from film",conn);
        JOptionPane.showMessageDialog(null,"here: \n"+lm.getSize());
        
    }
     private void updateTable(){
//        try{
//            String sql = "select * from custdetails";
//            pst=conn.prepareStatement(sql);
//            rs=pst.executeQuery();
//            filmsNowShowingList.setModel(DbUtils.resultSetToTableModel(rs));
//            
//    }
//        catch(Exception e){
//            JOptionPane.showMessageDialog(null,"Error Occured, details below: \n"+e);
//        }
    }
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        classificationButtonGroup = new javax.swing.ButtonGroup();
        screenButtonGroup = new javax.swing.ButtonGroup();
        movieDetailsPanel = new javax.swing.JPanel();
        classificationLabel = new javax.swing.JLabel();
        classificationButtonPanel = new javax.swing.JPanel();
        gClassificationButton = new javax.swing.JToggleButton();
        pgClassificationButton = new javax.swing.JToggleButton();
        twelveClassification = new javax.swing.JToggleButton();
        fifteenAClassificationButton = new javax.swing.JToggleButton();
        sixteenClassificationButton = new javax.swing.JToggleButton();
        eighteenClassificationButton = new javax.swing.JToggleButton();
        releaseDateLabel = new javax.swing.JLabel();
        starringLabel = new javax.swing.JLabel();
        durationLabel = new javax.swing.JLabel();
        synopsisLabel = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        synopsisTextArea = new javax.swing.JTextArea();
        screenLabel = new javax.swing.JLabel();
        screenPanel = new javax.swing.JPanel();
        screen1ToggleButton = new javax.swing.JToggleButton();
        screen2ToggleButton = new javax.swing.JToggleButton();
        screen3ToggleButton = new javax.swing.JToggleButton();
        screen4ToggleButton = new javax.swing.JToggleButton();
        screen5ToggleButton = new javax.swing.JToggleButton();
        screen6ToggleButton = new javax.swing.JToggleButton();
        screen7ToggleButton = new javax.swing.JToggleButton();
        screen8ToggleButton = new javax.swing.JToggleButton();
        starringTextField = new javax.swing.JTextField();
        durationTextField = new javax.swing.JTextField();
        jPanel1 = new javax.swing.JPanel();
        movieTitleTextField = new javax.swing.JTextField();
        movieTitleLabel = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        studioComboBox = new javax.swing.JComboBox();
        jScrollPane2 = new javax.swing.JScrollPane();
        filmsNowShowingList = new javax.swing.JList();
        filmsNowShowingLabel = new javax.swing.JLabel();
        actionPanel = new javax.swing.JPanel();
        addButton = new javax.swing.JButton();
        removeButton = new javax.swing.JButton();
        editButton = new javax.swing.JButton();
        updateButton = new javax.swing.JButton();
        backButton = new javax.swing.JButton();
        nextButton = new javax.swing.JButton();
        exitToMenuButton = new javax.swing.JButton();
        directorLabel = new javax.swing.JLabel();
        directorTextField = new javax.swing.JTextField();
        releaseDateDatePicker = new org.jdesktop.swingx.JXDatePicker();
        headerPanel = new javax.swing.JPanel();
        odeonLogoLbl = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                formWindowClosing(evt);
            }
        });

        movieDetailsPanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Movie Details", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION));
        movieDetailsPanel.setPreferredSize(new java.awt.Dimension(1024, 768));

        classificationLabel.setText("Classification");

        classificationButtonGroup.add(gClassificationButton);
        gClassificationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/gIcon.png"))); // NOI18N
        gClassificationButton.setBorder(null);
        gClassificationButton.setBorderPainted(false);
        gClassificationButton.setEnabled(false);
        gClassificationButton.setFocusPainted(false);
        gClassificationButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                gClassificationButtonMouseEntered(evt);
            }
        });
        gClassificationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                gClassificationButtonActionPerformed(evt);
            }
        });
        classificationButtonPanel.add(gClassificationButton);

        classificationButtonGroup.add(pgClassificationButton);
        pgClassificationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/pcIcon.png"))); // NOI18N
        pgClassificationButton.setBorder(null);
        pgClassificationButton.setBorderPainted(false);
        pgClassificationButton.setEnabled(false);
        pgClassificationButton.setPreferredSize(new java.awt.Dimension(50, 50));
        pgClassificationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                pgClassificationButtonActionPerformed(evt);
            }
        });
        classificationButtonPanel.add(pgClassificationButton);

        classificationButtonGroup.add(twelveClassification);
        twelveClassification.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/12Icon.png"))); // NOI18N
        twelveClassification.setBorder(null);
        twelveClassification.setBorderPainted(false);
        twelveClassification.setEnabled(false);
        twelveClassification.setPreferredSize(new java.awt.Dimension(50, 50));
        twelveClassification.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                twelveClassificationActionPerformed(evt);
            }
        });
        classificationButtonPanel.add(twelveClassification);

        classificationButtonGroup.add(fifteenAClassificationButton);
        fifteenAClassificationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/15Icon.png"))); // NOI18N
        fifteenAClassificationButton.setBorder(null);
        fifteenAClassificationButton.setBorderPainted(false);
        fifteenAClassificationButton.setEnabled(false);
        fifteenAClassificationButton.setPreferredSize(new java.awt.Dimension(50, 50));
        fifteenAClassificationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fifteenAClassificationButtonActionPerformed(evt);
            }
        });
        classificationButtonPanel.add(fifteenAClassificationButton);

        classificationButtonGroup.add(sixteenClassificationButton);
        sixteenClassificationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/16Icon.png"))); // NOI18N
        sixteenClassificationButton.setBorder(null);
        sixteenClassificationButton.setBorderPainted(false);
        sixteenClassificationButton.setEnabled(false);
        sixteenClassificationButton.setPreferredSize(new java.awt.Dimension(50, 50));
        sixteenClassificationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sixteenClassificationButtonActionPerformed(evt);
            }
        });
        classificationButtonPanel.add(sixteenClassificationButton);

        classificationButtonGroup.add(eighteenClassificationButton);
        eighteenClassificationButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/18Icon.png"))); // NOI18N
        eighteenClassificationButton.setBorder(null);
        eighteenClassificationButton.setBorderPainted(false);
        eighteenClassificationButton.setEnabled(false);
        eighteenClassificationButton.setPreferredSize(new java.awt.Dimension(50, 50));
        eighteenClassificationButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                eighteenClassificationButtonActionPerformed(evt);
            }
        });
        classificationButtonPanel.add(eighteenClassificationButton);

        releaseDateLabel.setText("Release Date: ");

        starringLabel.setText("Starring: ");

        durationLabel.setText("Duration: ");

        synopsisLabel.setText("Synopsis: ");

        synopsisTextArea.setColumns(20);
        synopsisTextArea.setRows(5);
        synopsisTextArea.setEnabled(false);
        synopsisTextArea.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                synopsisTextAreaMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(synopsisTextArea);

        screenLabel.setText("Screen: ");

        screen1ToggleButton.setBackground(new java.awt.Color(250, 250, 250));
        screenButtonGroup.add(screen1ToggleButton);
        screen1ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-1-icon.png"))); // NOI18N
        screen1ToggleButton.setBorder(null);
        screen1ToggleButton.setEnabled(false);
        screen1ToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                screen1ToggleButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                screen1ToggleButtonMouseExited(evt);
            }
        });
        screen1ToggleButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                screen1ToggleButtonActionPerformed(evt);
            }
        });
        screenPanel.add(screen1ToggleButton);

        screen2ToggleButton.setBackground(new java.awt.Color(250, 250, 250));
        screenButtonGroup.add(screen2ToggleButton);
        screen2ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-2-icon.png"))); // NOI18N
        screen2ToggleButton.setBorder(null);
        screen2ToggleButton.setEnabled(false);
        screen2ToggleButton.setOpaque(true);
        screen2ToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                screen2ToggleButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                screen2ToggleButtonMouseExited(evt);
            }
        });
        screen2ToggleButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                screen2ToggleButtonActionPerformed(evt);
            }
        });
        screenPanel.add(screen2ToggleButton);

        screen3ToggleButton.setBackground(new java.awt.Color(250, 250, 250));
        screenButtonGroup.add(screen3ToggleButton);
        screen3ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-3-icon.png"))); // NOI18N
        screen3ToggleButton.setBorder(null);
        screen3ToggleButton.setEnabled(false);
        screen3ToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                screen3ToggleButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                screen3ToggleButtonMouseExited(evt);
            }
        });
        screen3ToggleButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                screen3ToggleButtonActionPerformed(evt);
            }
        });
        screenPanel.add(screen3ToggleButton);

        screen4ToggleButton.setBackground(new java.awt.Color(250, 250, 250));
        screenButtonGroup.add(screen4ToggleButton);
        screen4ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-4-icon.png"))); // NOI18N
        screen4ToggleButton.setBorder(null);
        screen4ToggleButton.setEnabled(false);
        screen4ToggleButton.setOpaque(true);
        screen4ToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                screen4ToggleButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                screen4ToggleButtonMouseExited(evt);
            }
        });
        screen4ToggleButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                screen4ToggleButtonActionPerformed(evt);
            }
        });
        screenPanel.add(screen4ToggleButton);

        screen5ToggleButton.setBackground(new java.awt.Color(250, 250, 250));
        screenButtonGroup.add(screen5ToggleButton);
        screen5ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-5-icon.png"))); // NOI18N
        screen5ToggleButton.setBorder(null);
        screen5ToggleButton.setEnabled(false);
        screen5ToggleButton.setOpaque(true);
        screen5ToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                screen5ToggleButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                screen5ToggleButtonMouseExited(evt);
            }
        });
        screen5ToggleButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                screen5ToggleButtonActionPerformed(evt);
            }
        });
        screenPanel.add(screen5ToggleButton);

        screen6ToggleButton.setBackground(new java.awt.Color(250, 250, 250));
        screenButtonGroup.add(screen6ToggleButton);
        screen6ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-6-icon.png"))); // NOI18N
        screen6ToggleButton.setBorder(null);
        screen6ToggleButton.setEnabled(false);
        screen6ToggleButton.setOpaque(true);
        screen6ToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                screen6ToggleButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                screen6ToggleButtonMouseExited(evt);
            }
        });
        screen6ToggleButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                screen6ToggleButtonActionPerformed(evt);
            }
        });
        screenPanel.add(screen6ToggleButton);

        screen7ToggleButton.setBackground(new java.awt.Color(250, 250, 250));
        screenButtonGroup.add(screen7ToggleButton);
        screen7ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-7-icon.png"))); // NOI18N
        screen7ToggleButton.setBorder(null);
        screen7ToggleButton.setEnabled(false);
        screen7ToggleButton.setOpaque(true);
        screen7ToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                screen7ToggleButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                screen7ToggleButtonMouseExited(evt);
            }
        });
        screen7ToggleButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                screen7ToggleButtonActionPerformed(evt);
            }
        });
        screenPanel.add(screen7ToggleButton);

        screen8ToggleButton.setBackground(new java.awt.Color(250, 250, 250));
        screenButtonGroup.add(screen8ToggleButton);
        screen8ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-8-icon.png"))); // NOI18N
        screen8ToggleButton.setSelected(true);
        screen8ToggleButton.setBorder(null);
        screen8ToggleButton.setEnabled(false);
        screen8ToggleButton.setOpaque(true);
        screen8ToggleButton.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseEntered(java.awt.event.MouseEvent evt) {
                screen8ToggleButtonMouseEntered(evt);
            }
            public void mouseExited(java.awt.event.MouseEvent evt) {
                screen8ToggleButtonMouseExited(evt);
            }
        });
        screen8ToggleButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                screen8ToggleButtonActionPerformed(evt);
            }
        });
        screenPanel.add(screen8ToggleButton);

        starringTextField.setText(" ");
        starringTextField.setEnabled(false);
        starringTextField.setPreferredSize(new java.awt.Dimension(6, 20));

        durationTextField.setEnabled(false);

        jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

        movieTitleTextField.setEnabled(false);
        movieTitleTextField.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                movieTitleTextFieldActionPerformed(evt);
            }
        });

        movieTitleLabel.setText("Movie Title: ");

        jLabel1.setText("Studio: ");

        studioComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Select One", "Paramount", "Fox", "Disney", "Sony", "MGM", "Dreamworks", "Lionsgate" }));
        studioComboBox.setEnabled(false);

        filmsNowShowingList.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                filmsNowShowingListMouseClicked(evt);
            }
        });
        jScrollPane2.setViewportView(filmsNowShowingList);

        filmsNowShowingLabel.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        filmsNowShowingLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        filmsNowShowingLabel.setText("Now Showing");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(movieTitleLabel)
                        .addGap(18, 18, 18)
                        .addComponent(movieTitleTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 410, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addGap(39, 39, 39)
                        .addComponent(studioComboBox, 0, 410, Short.MAX_VALUE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(filmsNowShowingLabel)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 470, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(filmsNowShowingLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(movieTitleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(movieTitleLabel))
                        .addGap(12, 12, 12)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(studioComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel1)))
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel1Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {movieTitleTextField, studioComboBox});

        addButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/edit_add-128.png"))); // NOI18N
        addButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0), 2));
        addButton.setBorderPainted(false);
        addButton.setContentAreaFilled(false);
        addButton.setOpaque(true);
        addButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addButtonActionPerformed(evt);
            }
        });
        actionPanel.add(addButton);

        removeButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/edit_remove-128.png"))); // NOI18N
        removeButton.setBorderPainted(false);
        removeButton.setContentAreaFilled(false);
        removeButton.setEnabled(false);
        removeButton.setOpaque(true);
        removeButton.setPreferredSize(new java.awt.Dimension(53, 53));
        removeButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                removeButtonActionPerformed(evt);
            }
        });
        actionPanel.add(removeButton);

        editButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/edit-128.png"))); // NOI18N
        editButton.setBorderPainted(false);
        editButton.setContentAreaFilled(false);
        editButton.setEnabled(false);
        editButton.setOpaque(true);
        editButton.setPreferredSize(new java.awt.Dimension(53, 53));
        editButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                editButtonActionPerformed(evt);
            }
        });
        actionPanel.add(editButton);

        updateButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/save.png"))); // NOI18N
        updateButton.setBorderPainted(false);
        updateButton.setContentAreaFilled(false);
        updateButton.setEnabled(false);
        updateButton.setOpaque(true);
        updateButton.setPreferredSize(new java.awt.Dimension(53, 53));
        updateButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                updateButtonActionPerformed(evt);
            }
        });
        actionPanel.add(updateButton);

        backButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/back_arrow-128.png"))); // NOI18N
        backButton.setBorderPainted(false);
        backButton.setContentAreaFilled(false);
        backButton.setEnabled(false);
        backButton.setOpaque(true);
        backButton.setPreferredSize(new java.awt.Dimension(53, 53));
        backButton.setRequestFocusEnabled(false);
        backButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                backButtonActionPerformed(evt);
            }
        });
        actionPanel.add(backButton);

        nextButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/forward_arrow-128.png"))); // NOI18N
        nextButton.setBorderPainted(false);
        nextButton.setContentAreaFilled(false);
        nextButton.setEnabled(false);
        nextButton.setOpaque(true);
        nextButton.setPreferredSize(new java.awt.Dimension(53, 53));
        nextButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nextButtonActionPerformed(evt);
            }
        });
        actionPanel.add(nextButton);

        exitToMenuButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/house.png"))); // NOI18N
        exitToMenuButton.setToolTipText("Exit to main menu");
        exitToMenuButton.setBorderPainted(false);
        exitToMenuButton.setContentAreaFilled(false);
        exitToMenuButton.setPreferredSize(new java.awt.Dimension(53, 53));
        exitToMenuButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitToMenuButtonActionPerformed(evt);
            }
        });
        actionPanel.add(exitToMenuButton);

        directorLabel.setText("Director: ");

        directorTextField.setEnabled(false);

        releaseDateDatePicker.setEnabled(false);
        releaseDateDatePicker.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                releaseDateDatePickerActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout movieDetailsPanelLayout = new javax.swing.GroupLayout(movieDetailsPanel);
        movieDetailsPanel.setLayout(movieDetailsPanelLayout);
        movieDetailsPanelLayout.setHorizontalGroup(
            movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, movieDetailsPanelLayout.createSequentialGroup()
                                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(durationLabel)
                                    .addComponent(releaseDateLabel))
                                .addGap(50, 50, 50)
                                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(directorTextField)
                                    .addComponent(durationTextField)
                                    .addComponent(releaseDateDatePicker, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(synopsisLabel)
                                    .addComponent(starringLabel))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(starringTextField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 549, Short.MAX_VALUE)))
                            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                                .addComponent(classificationLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(classificationButtonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(actionPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 953, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(directorLabel))
                    .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(screenLabel)
                        .addGap(35, 35, 35)
                        .addComponent(screenPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(65, Short.MAX_VALUE))
        );
        movieDetailsPanelLayout.setVerticalGroup(
            movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, movieDetailsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(classificationLabel)
                    .addComponent(classificationButtonPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                        .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(starringTextField, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(starringLabel))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(synopsisLabel)
                        .addGap(98, 98, 98))
                    .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                        .addComponent(releaseDateDatePicker, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, movieDetailsPanelLayout.createSequentialGroup()
                        .addGap(5, 5, 5)
                        .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                                .addComponent(releaseDateLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(durationTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(durationLabel))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(directorTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(directorLabel))
                        .addGap(61, 61, 61)))
                .addGroup(movieDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(movieDetailsPanelLayout.createSequentialGroup()
                        .addGap(15, 15, 15)
                        .addComponent(screenLabel))
                    .addComponent(screenPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(actionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        movieDetailsPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {directorTextField, durationTextField, releaseDateDatePicker});

        headerPanel.setBackground(new java.awt.Color(0, 153, 153));

        odeonLogoLbl.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/odeon_logo.png"))); // NOI18N
        headerPanel.add(odeonLogoLbl);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(headerPanel, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 1136, Short.MAX_VALUE)
            .addGroup(layout.createSequentialGroup()
                .addComponent(movieDetailsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 1071, Short.MAX_VALUE)
                .addGap(65, 65, 65))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addComponent(headerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 106, Short.MAX_VALUE)
                .addGap(4, 4, 4)
                .addComponent(movieDetailsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 519, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents
    private void pgClassificationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_pgClassificationButtonActionPerformed
        clearClassification();
        classification="PG";
        
        clearClassificationButtons();
        if(getPgClassificationButton().isSelected()==true){
            
            
            getPgClassificationButton().setBorderPainted(true);
            //set border for currently selected object.
        }
           
        
    }//GEN-LAST:event_pgClassificationButtonActionPerformed

    private void twelveClassificationActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_twelveClassificationActionPerformed
        clearClassification();
        classification="12A";
        clearClassificationButtons();
        if(getTwelveClassification().isSelected()==true){
            getTwelveClassification().setBorderPainted(true);
       }
    }//GEN-LAST:event_twelveClassificationActionPerformed

    private void fifteenAClassificationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fifteenAClassificationButtonActionPerformed
        clearClassification();
        classification="15A";
        
        clearClassificationButtons();
        if(getFifteenAClassificationButton().isSelected()==true){
            getFifteenAClassificationButton().setBorderPainted(true);
       }
    }//GEN-LAST:event_fifteenAClassificationButtonActionPerformed

    private void sixteenClassificationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sixteenClassificationButtonActionPerformed
        clearClassification();
        classification="16";
        
        clearClassificationButtons(); 
        if(getSixteenClassificationButton().isSelected()==true){
            getSixteenClassificationButton().setBorderPainted(true);
       }
    }//GEN-LAST:event_sixteenClassificationButtonActionPerformed

    private void eighteenClassificationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_eighteenClassificationButtonActionPerformed
        clearClassification();
        classification="18";
        
        clearClassificationButtons();  
        if(getEighteenClassificationButton().isSelected()==true){
            getEighteenClassificationButton().setBorderPainted(true);
       }
    }//GEN-LAST:event_eighteenClassificationButtonActionPerformed

    private void gClassificationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_gClassificationButtonActionPerformed
        clearClassification();
        classification="PG";
        clearClassificationButtons();
          if(getgClassificationButton().isSelected()==true){
            getgClassificationButton().setBorderPainted(true);
       }
    }//GEN-LAST:event_gClassificationButtonActionPerformed

    private void gClassificationButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_gClassificationButtonMouseEntered
        // TODO add your handling code here:
    }//GEN-LAST:event_gClassificationButtonMouseEntered

    private void screen1ToggleButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen1ToggleButtonMouseEntered
        screen1ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-1-icon-mouseover.png")));
    }//GEN-LAST:event_screen1ToggleButtonMouseEntered

    private void screen1ToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_screen1ToggleButtonActionPerformed
        clearScreen();
        screen="1";
    if(screen1ToggleButton.isSelected()==true){
    screen1ToggleButton.setBorderPainted(true);
    screen1ToggleButton.setBorder(BorderFactory.createLineBorder(Color.red));
    screen1ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-1-icon-mouseover.png")));
    
    }
    else if(screen1ToggleButton.isSelected()==false){
    screen1ToggleButton.setBorderPainted(false);
    }
    }//GEN-LAST:event_screen1ToggleButtonActionPerformed

    private void screen1ToggleButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen1ToggleButtonMouseExited
        screen1ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-1-icon.png")));
        screen1ToggleButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-1-icon-mouseover.png")));
    }//GEN-LAST:event_screen1ToggleButtonMouseExited

    private void screen2ToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_screen2ToggleButtonActionPerformed
    clearScreen();
        screen="2";
    if(screen2ToggleButton.isSelected()==true){
    screen2ToggleButton.setBorderPainted(true);
    screen2ToggleButton.setBorder(BorderFactory.createLineBorder(Color.red));
    screen2ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-2-icon-mouseover.png")));
    screen2ToggleButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-2-icon-mouseover.png")));
    }
    else if(screen2ToggleButton.isSelected()==false){
    screen2ToggleButton.setBorderPainted(false);
    }
    }//GEN-LAST:event_screen2ToggleButtonActionPerformed

    private void screen3ToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_screen3ToggleButtonActionPerformed
    clearScreen();
        screen="3";
    if(screen3ToggleButton.isSelected()==true){
    screen3ToggleButton.setBorderPainted(true);
    screen3ToggleButton.setBorder(BorderFactory.createLineBorder(Color.red));
    screen3ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-3-icon-mouseover.png")));
    screen3ToggleButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-3-icon-mouseover.png")));
    }
    else if(screen3ToggleButton.isSelected()==false){
    screen3ToggleButton.setBorderPainted(false);
    }
    }//GEN-LAST:event_screen3ToggleButtonActionPerformed

    private void screen4ToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_screen4ToggleButtonActionPerformed
    clearScreen();
        screen="4";
    if(screen4ToggleButton.isSelected()==true){
    screen4ToggleButton.setBorderPainted(true);
    screen4ToggleButton.setBorder(BorderFactory.createLineBorder(Color.red));
    screen4ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-4-icon-mouseover.png")));
    screen4ToggleButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-4-icon-mouseover.png")));
    }
    else if(screen4ToggleButton.isSelected()==false){
    screen4ToggleButton.setBorderPainted(false);
    }
    }//GEN-LAST:event_screen4ToggleButtonActionPerformed

    private void screen5ToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_screen5ToggleButtonActionPerformed
    clearScreen();
        screen="5";
    if(screen5ToggleButton.isSelected()==true){
    screen5ToggleButton.setBorderPainted(true);
    screen5ToggleButton.setBorder(BorderFactory.createLineBorder(Color.red));
    screen5ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-5-icon-mouseover.png")));
    screen5ToggleButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-5-icon-mouseover.png")));
    }
    else if(screen5ToggleButton.isSelected()==false){
    screen5ToggleButton.setBorderPainted(false);
    }
    }//GEN-LAST:event_screen5ToggleButtonActionPerformed

    private void screen6ToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_screen6ToggleButtonActionPerformed
    clearScreen();
        screen="6";
    if(screen6ToggleButton.isSelected()==true){
    screen6ToggleButton.setBorderPainted(true);
    screen6ToggleButton.setBorder(BorderFactory.createLineBorder(Color.red));
    screen6ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-6-icon-mouseover.png")));
    screen6ToggleButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-6-icon-mouseover.png")));
    }
    else if(screen6ToggleButton.isSelected()==false){
    screen6ToggleButton.setBorderPainted(false);
    }
    }//GEN-LAST:event_screen6ToggleButtonActionPerformed

    private void screen7ToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_screen7ToggleButtonActionPerformed
    clearScreen();
        screen="7";
    if(screen7ToggleButton.isSelected()==true){
    screen7ToggleButton.setBorderPainted(true);
    screen7ToggleButton.setBorder(BorderFactory.createLineBorder(Color.red));
    screen7ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-7-icon-mouseover.png")));
    screen7ToggleButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-7-icon-mouseover.png")));
    }
    else if(screen7ToggleButton.isSelected()==false){
    screen7ToggleButton.setBorderPainted(false);
    }
    }//GEN-LAST:event_screen7ToggleButtonActionPerformed

    private void screen8ToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_screen8ToggleButtonActionPerformed
        clearScreen();
        screen="8";
    if(screen8ToggleButton.isSelected()==true){
    screen8ToggleButton.setBorderPainted(true);
    screen8ToggleButton.setBorder(BorderFactory.createLineBorder(Color.red));
    screen8ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-8-icon-mouseover.png")));
    screen8ToggleButton.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-8-icon-mouseover.png")));
    }
    else if(screen8ToggleButton.isSelected()==false){
    screen8ToggleButton.setBorderPainted(false);
    }
    }//GEN-LAST:event_screen8ToggleButtonActionPerformed

    private void screen2ToggleButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen2ToggleButtonMouseEntered
        screen2ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-2-icon-mouseover.png")));
    }//GEN-LAST:event_screen2ToggleButtonMouseEntered

    private void screen3ToggleButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen3ToggleButtonMouseEntered
        screen3ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-3-icon-mouseover.png")));
    }//GEN-LAST:event_screen3ToggleButtonMouseEntered

    private void screen4ToggleButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen4ToggleButtonMouseEntered
        screen4ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-4-icon-mouseover.png")));
    }//GEN-LAST:event_screen4ToggleButtonMouseEntered

    private void screen5ToggleButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen5ToggleButtonMouseEntered
        screen5ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-5-icon-mouseover.png")));
    }//GEN-LAST:event_screen5ToggleButtonMouseEntered

    private void screen6ToggleButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen6ToggleButtonMouseEntered
        screen6ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-6-icon-mouseover.png")));
    }//GEN-LAST:event_screen6ToggleButtonMouseEntered

    private void screen7ToggleButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen7ToggleButtonMouseEntered
        screen7ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-7-icon-mouseover.png")));
    }//GEN-LAST:event_screen7ToggleButtonMouseEntered

    private void screen8ToggleButtonMouseEntered(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen8ToggleButtonMouseEntered
        screen8ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-8-icon-mouseover.png")));
    }//GEN-LAST:event_screen8ToggleButtonMouseEntered

    private void screen2ToggleButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen2ToggleButtonMouseExited
        screen2ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-2-icon.png")));
    }//GEN-LAST:event_screen2ToggleButtonMouseExited

    private void screen3ToggleButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen3ToggleButtonMouseExited
        screen3ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-3-icon.png")));
    }//GEN-LAST:event_screen3ToggleButtonMouseExited

    private void screen4ToggleButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen4ToggleButtonMouseExited
        screen4ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-4-icon.png")));
    }//GEN-LAST:event_screen4ToggleButtonMouseExited

    private void screen5ToggleButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen5ToggleButtonMouseExited
        screen5ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-5-icon.png")));
    }//GEN-LAST:event_screen5ToggleButtonMouseExited

    private void screen6ToggleButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen6ToggleButtonMouseExited
        screen6ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-6-icon.png")));
    }//GEN-LAST:event_screen6ToggleButtonMouseExited

    private void screen7ToggleButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen7ToggleButtonMouseExited
        screen7ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-7-icon.png")));
    }//GEN-LAST:event_screen7ToggleButtonMouseExited

    private void screen8ToggleButtonMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_screen8ToggleButtonMouseExited
        screen8ToggleButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Number-8-icon.png")));
    }//GEN-LAST:event_screen8ToggleButtonMouseExited

    private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
        int currentSelection = getFilmsNowShowingList().getSelectedIndex();
        int exit = JOptionPane.showConfirmDialog(null, "Are you sure You Want To Delete:\n"+lm.toString());
        if (exit == JOptionPane.YES_OPTION) {
            try {
                getLm().remove(currentSelection);
                al.remove(currentSelection);
            } 
            catch (Exception e) {
                JOptionPane.showMessageDialog(null, "An Exception Occured: " + e.getMessage());
            }
        }
        if (exit == JOptionPane.NO_OPTION) {
            JOptionPane.showMessageDialog(null, "ITS OK!!!, Did Not Delete: \n"+getLm().get(currentSelection));
        }
        if (exit == JOptionPane.CANCEL_OPTION) {
            
        }

        
        
       
    }//GEN-LAST:event_removeButtonActionPerformed

    private void addButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addButtonActionPerformed
        int i=getLm().getSize();                // get current size of list model jlist holding titles
        if(i<=8){
            movieTitleTextField.requestFocus();
            enableAll();
            addButton.setEnabled(false);        //disable add button
            removeButton.setEnabled(false);     //enable remove button
            editButton.setEnabled(false);       //enable edit button 
            updateButton.setEnabled(true);      //disable save button as nothing to save unless something clicked
            backButton.setEnabled(false);       //enable next button so list can be moved through
            nextButton.setEnabled(false);       //enable foreward button so list can be cycled through
            exitToMenuButton.setEnabled(true);  //enable exit to menu so that user can go to retail or sales report screen
        }
        else if(i>=8){
            disableAll();                       //disable all form elements
            JOptionPane.showMessageDialog(null, "You Cannot Add a Movie, There are 8 already in the System","Error,Library Full",JOptionPane.ERROR_MESSAGE);
            addButton.setEnabled(false);        //disable add button
            removeButton.setEnabled(false);     //enable remove button
            editButton.setEnabled(false);       //enable edit button 
            updateButton.setEnabled(false);     //disable save button as nothing to save unless something clicked
            backButton.setEnabled(true);        //enable next button so list can be moved through
            nextButton.setEnabled(true);        //enable foreward button so list can be cycled through
            exitToMenuButton.setEnabled(true);  //enable exit to menu so that user can go to retail or sales report screen
        }       
    }//GEN-LAST:event_addButtonActionPerformed

    private void releaseDateDatePickerActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_releaseDateDatePickerActionPerformed
       
    }//GEN-LAST:event_releaseDateDatePickerActionPerformed

    private void exitToMenuButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitToMenuButtonActionPerformed
        
     utilities.exitToMenu();


    }//GEN-LAST:event_exitToMenuButtonActionPerformed
    public String checkInput(){
        String output="";
        boolean textFieldContents = movieTitleTextField.getText().isEmpty();
        boolean durationEmpty = durationTextField.getText().isEmpty();
        if(movieTitleTextField.getText()==null||textFieldContents==true){
            output+="- Please Enter a value for MOVIE TITLE\n";
        }
        if(studioComboBox.getSelectedItem()=="Select One"){
            output+="- Please Pick a value for Studio Selection\n";
        }
        try{
        if(durationTextField.getText()==null||durationEmpty==true){
            output+="- Please Enter a NUMERIC Value for Duration\n";
            
        }
        }
        catch(NumberFormatException nfe){
            output+="- You Need to enter a NUMERIC value for Duration! not:"+durationTextField.getText().toString()+"\n";
            //not working needs fixing
        }
        
    
        
        
        
        return output;
    }
    private void updateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateButtonActionPerformed
        JOptionPane.showMessageDialog(null,"here: \n"+lm.getSize());
        Connection conn=utilities.connectDB(); // open database connection
        ResultSet rs = null;
        PreparedStatement pst = null;
        String date = sdf.format(releaseDateDatePicker.getDate()); //apply date format to date object for insert to db
               if(checkInput()==""){ 
                   //input validation for form is ok so enter to database
        try{
            //no need to enter customer id because it is auto generated
            String sql = "insert into film(title,studio,classification,releasedate,duration,director,screen,starring,synopsis) values(?,?,?,?,?,?,?,?,?)";
            pst=conn.prepareStatement(sql);
            //pst.setString(1, ); // is auto incremented/generated in database anyway
            pst.setString(1, movieTitleTextField.getText());
            pst.setString(2, studioComboBox.getSelectedItem().toString());
            pst.setString(3, classification);
            pst.setString(4, date);
            pst.setString(5, durationTextField.getText());
            pst.setString(6, directorTextField.getText());
            pst.setString(7, screen);
            System.out.println(screenButtonGroup.getSelection().toString());
            pst.setString(8, starringTextField.getText());
            pst.setString(9, synopsisTextArea.getText());
            
            
            //excecute the prepared statement
            pst.execute();
            
            
            
            JOptionPane.showMessageDialog(null, "Successfully added new Movie: \n"+movieTitleTextField.getText());
            clearForm(); // clear form contents
        } 
        catch (Exception e){
            JOptionPane.showMessageDialog(null, "Oops, an error Occured, \n Error Description:\n"+e);
            
        
        }
               }
               else JOptionPane.showMessageDialog(null,"Please Correct the following: "+checkInput());
        
        
        
        
        
        
        
    }//GEN-LAST:event_updateButtonActionPerformed

    private void editButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_editButtonActionPerformed
       enableAll();
       editButton.setEnabled(false);
       addButton.setEnabled(false);
       updateButton.setEnabled(true);
       
       //call add movie and re add movie object ... delete old version 
    }//GEN-LAST:event_editButtonActionPerformed

    private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
        utilities.exitToMenu();
    }//GEN-LAST:event_formWindowClosing

    private void nextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nextButtonActionPerformed
        int id = filmsNowShowingList.getSelectedIndex();
        if (++id <0) {
            id = al.size()+1;
        }
        filmsNowShowingList.setSelectedIndex(id++); //foreward through list
        getFilm(filmsNowShowingList.getSelectedIndex());
        //films as in arraylist that films stored in 
       id = filmsNowShowingList.getSelectedIndex();
    }//GEN-LAST:event_nextButtonActionPerformed
    public void getFilm(int id){
        
    }
    
    private void backButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_backButtonActionPerformed
         int id = filmsNowShowingList.getSelectedIndex();
        if (--id <0) {
            id = al.size()-1;
        }
        filmsNowShowingList.setSelectedIndex(id--); // back through list
        getFilm(filmsNowShowingList.getSelectedIndex());
//films as in arraylist that films stored in 
       id = filmsNowShowingList.getSelectedIndex();
    }//GEN-LAST:event_backButtonActionPerformed

    private void filmsNowShowingListMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_filmsNowShowingListMouseClicked
        removeButton.setEnabled(true);
      
    }//GEN-LAST:event_filmsNowShowingListMouseClicked

    private void movieTitleTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_movieTitleTextFieldActionPerformed


    }//GEN-LAST:event_movieTitleTextFieldActionPerformed

    private void synopsisTextAreaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_synopsisTextAreaMouseClicked
       
    }//GEN-LAST:event_synopsisTextAreaMouseClicked

    
//    public static void main(String args[]) {
//        
//        /* Set the Nimbus look and feel */
//        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
//        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
//         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
//         */
//        try {
//            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
//                if ("Nimbus".equals(info.getName())) {
//                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
//                    break;
//                }
//            }
//        } catch (ClassNotFoundException ex) {
//            java.util.logging.Logger.getLogger(adminFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (InstantiationException ex) {
//            java.util.logging.Logger.getLogger(adminFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (IllegalAccessException ex) {
//            java.util.logging.Logger.getLogger(adminFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
//            java.util.logging.Logger.getLogger(adminFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
//        }
//        //</editor-fold>
//
//        /* Create and display the form */
//        java.awt.EventQueue.invokeLater(new Runnable() {
//
//            
//            public void run() {
//                new adminFrame().setVisible(true);
//            }
//        });
//       
//    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel actionPanel;
    private javax.swing.JButton addButton;
    private javax.swing.JButton backButton;
    private javax.swing.ButtonGroup classificationButtonGroup;
    private javax.swing.JPanel classificationButtonPanel;
    private javax.swing.JLabel classificationLabel;
    private javax.swing.JLabel directorLabel;
    private javax.swing.JTextField directorTextField;
    private javax.swing.JLabel durationLabel;
    private javax.swing.JTextField durationTextField;
    private javax.swing.JButton editButton;
    private javax.swing.JToggleButton eighteenClassificationButton;
    private javax.swing.JButton exitToMenuButton;
    private javax.swing.JToggleButton fifteenAClassificationButton;
    private javax.swing.JLabel filmsNowShowingLabel;
    public static javax.swing.JList filmsNowShowingList;
    private javax.swing.JToggleButton gClassificationButton;
    private javax.swing.JPanel headerPanel;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JPanel movieDetailsPanel;
    private javax.swing.JLabel movieTitleLabel;
    private javax.swing.JTextField movieTitleTextField;
    private javax.swing.JButton nextButton;
    private javax.swing.JLabel odeonLogoLbl;
    private javax.swing.JToggleButton pgClassificationButton;
    private org.jdesktop.swingx.JXDatePicker releaseDateDatePicker;
    private javax.swing.JLabel releaseDateLabel;
    private javax.swing.JButton removeButton;
    private javax.swing.JToggleButton screen1ToggleButton;
    private javax.swing.JToggleButton screen2ToggleButton;
    private javax.swing.JToggleButton screen3ToggleButton;
    private javax.swing.JToggleButton screen4ToggleButton;
    private javax.swing.JToggleButton screen5ToggleButton;
    private javax.swing.JToggleButton screen6ToggleButton;
    private javax.swing.JToggleButton screen7ToggleButton;
    private javax.swing.JToggleButton screen8ToggleButton;
    private javax.swing.ButtonGroup screenButtonGroup;
    private javax.swing.JLabel screenLabel;
    private javax.swing.JPanel screenPanel;
    private javax.swing.JToggleButton sixteenClassificationButton;
    private javax.swing.JLabel starringLabel;
    private javax.swing.JTextField starringTextField;
    private javax.swing.JComboBox studioComboBox;
    private javax.swing.JLabel synopsisLabel;
    private javax.swing.JTextArea synopsisTextArea;
    private javax.swing.JToggleButton twelveClassification;
    private javax.swing.JButton updateButton;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the classificationButtonGroup
     */
    public javax.swing.ButtonGroup getClassificationButtonGroup() {
        return classificationButtonGroup;
    }

    /**
     * @param classificationButtonGroup the classificationButtonGroup to set
     */
    public void setClassificationButtonGroup(javax.swing.ButtonGroup classificationButtonGroup) {
        this.classificationButtonGroup = classificationButtonGroup;
    }

    /**
     * @return the classificationButtonPanel
     */
    public javax.swing.JPanel getClassificationButtonPanel() {
        return classificationButtonPanel;
    }

    /**
     * @param classificationButtonPanel the classificationButtonPanel to set
     */
    public void setClassificationButtonPanel(javax.swing.JPanel classificationButtonPanel) {
        this.classificationButtonPanel = classificationButtonPanel;
    }

    /**
     * @return the classificationLabel
     */
    public javax.swing.JLabel getClassificationLabel() {
        return classificationLabel;
    }

    /**
     * @param classificationLabel the classificationLabel to set
     */
    public void setClassificationLabel(javax.swing.JLabel classificationLabel) {
        this.classificationLabel = classificationLabel;
    }

    /**
     * @return the gClassificationButton
     */
    public javax.swing.JToggleButton getgClassificationButton() {
        return gClassificationButton;
    }

    /**
     * @param gClassificationButton the gClassificationButton to set
     */
    public void setgClassificationButton(javax.swing.JToggleButton gClassificationButton) {
        this.gClassificationButton = gClassificationButton;
    }

    /**
     * @return the jLabel1
     */
    public javax.swing.JLabel getjLabel1() {
        return jLabel1;
    }

    /**
     * @param jLabel1 the jLabel1 to set
     */
    public void setjLabel1(javax.swing.JLabel jLabel1) {
        this.jLabel1 = jLabel1;
    }

    /**
     * @return the jToggleButton4
     */
    public javax.swing.JToggleButton getjToggleButton4() {
        return getFifteenAClassificationButton();
    }

    /**
     * @param jToggleButton4 the jToggleButton4 to set
     */
    public void setjToggleButton4(javax.swing.JToggleButton jToggleButton4) {
        this.setFifteenAClassificationButton(getFifteenAClassificationButton());
    }

    /**
     * @return the jToggleButton5
     */
    public javax.swing.JToggleButton getjToggleButton5() {
        return getSixteenClassificationButton();
    }

    /**
     * @param jToggleButton5 the jToggleButton5 to set
     */
    public void setjToggleButton5(javax.swing.JToggleButton jToggleButton5) {
        this.setSixteenClassificationButton(getSixteenClassificationButton());
    }

    /**
     * @return the jToggleButton6
     */
    public javax.swing.JToggleButton getjToggleButton6() {
        return getEighteenClassificationButton();
    }

    /**
     * @param jToggleButton6 the jToggleButton6 to set
     */
    public void setjToggleButton6(javax.swing.JToggleButton jToggleButton6) {
        this.setEighteenClassificationButton(getEighteenClassificationButton());
    }

    /**
     * @return the movieDetailsPanel
     */
    public javax.swing.JPanel getMovieDetailsPanel() {
        return movieDetailsPanel;
    }

    /**
     * @param movieDetailsPanel the movieDetailsPanel to set
     */
    public void setMovieDetailsPanel(javax.swing.JPanel movieDetailsPanel) {
        this.movieDetailsPanel = movieDetailsPanel;
    }

    /**
     * @return the movieTitleJframe
     */
    public javax.swing.JTextField getMovieTitleJframe() {
        return movieTitleTextField;
    }

    /**
     * @param movieTitleJframe the movieTitleJframe to set
     */
    public void setMovieTitleJframe(javax.swing.JTextField movieTitleJframe) {
        this.movieTitleTextField = movieTitleJframe;
    }

    /**
     * @return the movieTitleLabel
     */
    public javax.swing.JLabel getMovieTitleLabel() {
        return movieTitleLabel;
    }

    /**
     * @param movieTitleLabel the movieTitleLabel to set
     */
    public void setMovieTitleLabel(javax.swing.JLabel movieTitleLabel) {
        this.movieTitleLabel = movieTitleLabel;
    }

    /**
     * @return the pgClassificationButton
     */
    public javax.swing.JToggleButton getPgClassificationButton() {
        return pgClassificationButton;
    }

    /**
     * @param pgClassificationButton the pgClassificationButton to set
     */
    public void setPgClassificationButton(javax.swing.JToggleButton pgClassificationButton) {
        this.pgClassificationButton = pgClassificationButton;
    }

    /**
     * @return the studioComboBox
     */
    public javax.swing.JComboBox getStudioComboBox() {
        return studioComboBox;
    }

    /**
     * @param studioComboBox the studioComboBox to set
     */
    public void setStudioComboBox(javax.swing.JComboBox studioComboBox) {
        this.studioComboBox = studioComboBox;
    }

    /**
     * @return the twelveClassification
     */
    public javax.swing.JToggleButton getTwelveClassification() {
        return twelveClassification;
    }

    /**
     * @param twelveClassification the twelveClassification to set
     */
    public void setTwelveClassification(javax.swing.JToggleButton twelveClassification) {
        this.twelveClassification = twelveClassification;
    }
    
    public void clearClassificationButtons(){
        getgClassificationButton().setBorderPainted(false);
        getPgClassificationButton().setBorderPainted(false);
        getTwelveClassification().setBorderPainted(false);
        getFifteenAClassificationButton().setBorderPainted(false);
        getSixteenClassificationButton().setBorderPainted(false);
        getEighteenClassificationButton().setBorderPainted(false);   
}
    public void clearScreenButtons(){
        {
        screen1ToggleButton.setBorderPainted(false);
        screen2ToggleButton.setBorderPainted(false);
        screen3ToggleButton.setBorderPainted(false);
        screen4ToggleButton.setBorderPainted(false);
        screen5ToggleButton.setBorderPainted(false);
        screen6ToggleButton.setBorderPainted(false);
        screen7ToggleButton.setBorderPainted(false);
        screen8ToggleButton.setBorderPainted(false);
}
    }

    /**
     * @return the eighteenClassificationButton
     */
    public javax.swing.JToggleButton getEighteenClassificationButton() {
        return eighteenClassificationButton;
    }

    /**
     * @param eighteenClassificationButton the eighteenClassificationButton to set
     */
    public void setEighteenClassificationButton(javax.swing.JToggleButton eighteenClassificationButton) {
        this.eighteenClassificationButton = eighteenClassificationButton;
    }

    /**
     * @return the fifteenAClassificationButton
     */
    public javax.swing.JToggleButton getFifteenAClassificationButton() {
        return fifteenAClassificationButton;
    }

    /**
     * @param fifteenAClassificationButton the fifteenAClassificationButton to set
     */
    public void setFifteenAClassificationButton(javax.swing.JToggleButton fifteenAClassificationButton) {
        this.fifteenAClassificationButton = fifteenAClassificationButton;
    }

    /**
     * @return the sixteenClassificationButton
     */
    public javax.swing.JToggleButton getSixteenClassificationButton() {
        return sixteenClassificationButton;
    }

    /**
     * @param sixteenClassificationButton the sixteenClassificationButton to set
     */
    public void setSixteenClassificationButton(javax.swing.JToggleButton sixteenClassificationButton) {
        this.sixteenClassificationButton = sixteenClassificationButton;
    }

    /**
     * @return the chooseLanguageLbl
     */
    

    /**
     * @return the durationLabel
     */
    public javax.swing.JLabel getDurationLabel() {
        return durationLabel;
    }

    /**
     * @param durationLabel the durationLabel to set
     */
    public void setDurationLabel(javax.swing.JLabel durationLabel) {
        this.durationLabel = durationLabel;
    }

    /**
     * @return the headerPanel
     */
    public javax.swing.JPanel getHeaderPanel() {
        return headerPanel;
    }

    /**
     * @param headerPanel the headerPanel to set
     */
    public void setHeaderPanel(javax.swing.JPanel headerPanel) {
        this.headerPanel = headerPanel;
    }

    /**
     * @return the jScrollPane1
     */
    public javax.swing.JScrollPane getjScrollPane1() {
        return jScrollPane1;
    }

    /**
     * @param jScrollPane1 the jScrollPane1 to set
     */
    public void setjScrollPane1(javax.swing.JScrollPane jScrollPane1) {
        this.jScrollPane1 = jScrollPane1;
    }

    /**
     * @return the jTextArea1
     */
    public javax.swing.JTextArea getSynopsisTextArea() {
        return synopsisTextArea;
    }

    /**
     * @param jTextArea1 the jTextArea1 to set
     */
    public void setjTextArea1(javax.swing.JTextArea synopsisTextArea) {
        this.synopsisTextArea = synopsisTextArea;
    }

    /**
     * @return the odeonLogoLbl
     */
    public javax.swing.JLabel getOdeonLogoLbl() {
        return odeonLogoLbl;
    }

    /**
     * @param odeonLogoLbl the odeonLogoLbl to set
     */
    public void setOdeonLogoLbl(javax.swing.JLabel odeonLogoLbl) {
        this.odeonLogoLbl = odeonLogoLbl;
    }

    /**
     * @return the releaseDateLabel
     */
    public javax.swing.JLabel getReleaseDateLabel() {
        return releaseDateLabel;
    }

    /**
     * @param releaseDateLabel the releaseDateLabel to set
     */
    public void setReleaseDateLabel(javax.swing.JLabel releaseDateLabel) {
        this.releaseDateLabel = releaseDateLabel;
    }
    

    /**
     * @return the screenButtonGroup
     */
    public javax.swing.ButtonGroup getScreenButtonGroup() {
        return screenButtonGroup;
    }

    /**
     * @param screenButtonGroup the screenButtonGroup to set
     */
    public void setScreenButtonGroup(javax.swing.ButtonGroup screenButtonGroup) {
        this.screenButtonGroup = screenButtonGroup;
    }

    /**
     * @return the screenLabel
     */
    public javax.swing.JLabel getScreenLabel() {
        return screenLabel;
    }

    /**
     * @param screenLabel the screenLabel to set
     */
    public void setScreenLabel(javax.swing.JLabel screenLabel) {
        this.screenLabel = screenLabel;
    }

    /**
     * @return the screenPanel
     */
    public javax.swing.JPanel getScreenPanel() {
        return screenPanel;
    }

    /**
     * @param screenPanel the screenPanel to set
     */
    public void setScreenPanel(javax.swing.JPanel screenPanel) {
        this.screenPanel = screenPanel;
    }

    /**
     * @return the starringLabel
     */
    public javax.swing.JLabel getStarringLabel() {
        return starringLabel;
    }

    /**
     * @param starringLabel the starringLabel to set
     */
    public void setStarringLabel(javax.swing.JLabel starringLabel) {
        this.starringLabel = starringLabel;
    }

    /**
     * @return the synopsisLabel
     */
    public javax.swing.JLabel getSynopsisLabel() {
        return synopsisLabel;
    }

    /**
     * @param synopsisLabel the synopsisLabel to set
     */
    public void setSynopsisLabel(javax.swing.JLabel synopsisLabel) {
        this.synopsisLabel = synopsisLabel;
    }

    public javax.swing.JToggleButton getjToggleButton1() {
        return screen1ToggleButton;
    }
    public void enableAll(){
        movieTitleTextField.setEnabled(true);
        studioComboBox.setEnabled(true);
        gClassificationButton.setEnabled(true);
        pgClassificationButton.setEnabled(true);
        twelveClassification.setEnabled(true);
        fifteenAClassificationButton.setEnabled(true);
        sixteenClassificationButton.setEnabled(true);
        eighteenClassificationButton.setEnabled(true);
        releaseDateDatePicker.setEnabled(true);
        starringTextField.setEnabled(true);
        durationTextField.setEnabled(true);
        directorTextField.setEnabled(true);
        screen1ToggleButton.setEnabled(true);
        screen2ToggleButton.setEnabled(true);
        screen3ToggleButton.setEnabled(true);
        screen4ToggleButton.setEnabled(true);
        screen5ToggleButton.setEnabled(true);
        screen6ToggleButton.setEnabled(true);
        screen7ToggleButton.setEnabled(true);
        screen8ToggleButton.setEnabled(true);
        synopsisTextArea.setEnabled(true);
        
    }   
    public void disableAll(){
        movieTitleTextField.setEnabled(false);
        studioComboBox.setEnabled(false);
        gClassificationButton.setEnabled(false);
        pgClassificationButton.setEnabled(false);
        twelveClassification.setEnabled(false);
        fifteenAClassificationButton.setEnabled(false);
        sixteenClassificationButton.setEnabled(false);
        eighteenClassificationButton.setEnabled(false);
        releaseDateDatePicker.setEnabled(false);
        starringTextField.setEnabled(false);
        durationTextField.setEnabled(false);
        directorTextField.setEnabled(false);
        screen1ToggleButton.setEnabled(false);
        screen2ToggleButton.setEnabled(false);
        screen3ToggleButton.setEnabled(false);
        screen4ToggleButton.setEnabled(false);
        screen5ToggleButton.setEnabled(false);
        screen6ToggleButton.setEnabled(false);
        screen7ToggleButton.setEnabled(false);
        screen8ToggleButton.setEnabled(false);
    }
    public void clearForm(){
        movieTitleTextField.setText(null);
        classificationButtonGroup.clearSelection();
        studioComboBox.setSelectedIndex(0);
        releaseDateDatePicker.setDate(null);
        starringTextField.setText(null);
        durationTextField.setText(null);
        directorTextField.setText(null);
        screenButtonGroup.clearSelection();
        synopsisTextArea.setText(null);
        
    }

    
    
    
    public Movie addMovie(){
        Movie newMovie = new Movie();
        String movieTitle = movieTitleTextField.getText();
        Object studio = studioComboBox.getSelectedItem();
        ButtonModel classification = classificationButtonGroup.getSelection();   
        String releaseDate = sdf.format(releaseDateDatePicker.getDate());
        String duration = durationTextField.getText();  
        String starring = starringTextField.getText();
        String synopsis = synopsisTextArea.getText();
        String director = directorTextField.getText();
        ButtonModel screen = screenButtonGroup.getSelection();
        newMovie.setTitle (movieTitle);// set each attribute of movie class equal to new movie instance
        newMovie.setStudio(studio);
        newMovie.setClassification(classification);
        newMovie.setReleaaseDate(releaseDate);
        newMovie.setDuration(duration);
        newMovie.setStarring(starring);
        newMovie.setSynopsis(synopsis);
        newMovie.setDirector(director);
        newMovie.setScreen(screen);
        
        al.add(newMovie); // add movie object to array list
        return newMovie;
    }

    /**
     * @return the filmsNowShowingList
     */
    public javax.swing.JList getFilmsNowShowingList() {
        return filmsNowShowingList;
    }

    /**
     * @param filmsNowShowingList the filmsNowShowingList to set
     */
    public void setFilmsNowShowingList(javax.swing.JList filmsNowShowingList) {
        this.filmsNowShowingList = filmsNowShowingList;
    }

    /**
     * @return the lm
     */
    public DefaultListModel getLm() {
        return lm;
    }

    /**
     * @param lm the lm to set
     */
    public void setLm(DefaultListModel lm) {
        this.lm = lm;
    }
    public void clearScreen(){
        screen="";
    }
    
      public void clearClassification(){
        screen="";
    }
      
//    public void populateJList(){
//    try{      
//    DefaultListModel lm = new DefaultListModel(); //create a new list model
//
//    Statement statement = conn.createStatement();
//    ResultSet rs = statement.executeQuery("select * from film order by title asc"); //run your query
//
//    while (rs.next()) //go through each row that your query returns
//    {
//        String itemCode = rs.getString("title"); //get the element in column "item_code"
//        lm.addElement(itemCode); //add each item to the model
//    }
//    filmsNowShowingList.setModel(lm);
//
//    rs.close();
//    statement.close();
//    }
//    catch(Exception e){
//        JOptionPane.showMessageDialog(null, "An Error Occured!\n"+e.getMessage());
//    }
//}
}

